#pragma once

#include<iostream>

using namespace std;

class Date
{
public:
	Date(int year = 1900, int month = 1, int day = 1);
	int GetMonthDay(int year, int month)
	{
		int arr[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
		if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
		{
			return 29;
		}
		return arr[month];
	}
	Date(const Date& d);
	void Print()const;
	Date& operator =(const Date& d);
	~Date();
	Date& operator +=(int day);
	Date operator +(int day)const;
	Date& operator -=(int day);
	Date operator -(int day)const;
	Date& operator ++();
	Date operator ++(int);
	Date operator --(int);
	Date& operator --();
	bool operator >(const Date& d)const;
	bool operator ==(const Date& d)const;
	bool operator >=(const Date& d)const;
	bool operator <(const Date& d)const;
	bool operator <=(const Date& d)const;
	bool operator !=(const Date& d)const;
	int operator -(const Date& d)const;
private:
	int _year;
	int _month;
	int _day;
};